import http from '@/utils/http';



/**
 * 删除区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const removeSubStructureDynamic = (params: any) => {
  return http.delete('bus/subStructureDynamic/remove', {params});
}

/**
 * 获取系统用户列表
 * @param params
 * @returns {*|Promise<any>}
 */
export const getSubStructureDynamicList = (params?: any) => {
  return http.get('bus/subStructureDynamic/list', {params});
}

export const queryByStructureId = (params?: any) => {
  return http.get('bus/subStructureDynamic/queryByStructureId?id=' + params.id);
}


/**
 * 保存修改区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const updateSubStructureDynamic = (params: any) => {
  return http.put('bus/subStructureDynamic/edit', params);
}

/**
 * 保存新增区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const addSubStructureDynamic = (params: any) => {
  return http.post('bus/subStructureDynamic/add', params);
}

/**
 * 通过id获取区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const getSubStructureById = (params: any) => {
  return http.get('bus/subStructureDynamic/' + params.id);
}

/**
 * 验证区域名称是否唯一
 * @param params
 * @returns {*|Promise<any>}
 */
// export const checkSubStructureCommonNameUnique = (params: any) => {
//   params.loading = false;
//   return http.post('bus/subStructureDynamic/checkNameUnique', params);
// }

